package library.persistence.service;

import library.domain.Book;
import library.persistence.impl.BookDaoImpl;

import java.util.List;

public class BookService {

    public List<Book> getAllBook(){
        return new BookDaoImpl().getAllBook();
    };

    public Book getBookByBookId(int bookId){
        return new BookDaoImpl().getBookByBookId(bookId);
    };

    public Book getBookByBookName(String bookName){
        return new BookDaoImpl().getBookByBookName(bookName);
    };

    public void insertBook(Book book){
        new BookDaoImpl().insertBook(book);
    };

    public void updateBookByBookId(Book book){
        new BookDaoImpl().updateBookByBookId(book);
    };

    public void deleteBookByBookId(int id){
        new BookDaoImpl().deleteBookByBookId(id);
    };

    public void deleteBookByBookName(String bookName){
        new BookDaoImpl().deleteBookByBookName(bookName);
    };

    public List<Book> searchBookList(String keyword){
        return new BookDaoImpl().searchBookList(keyword);
    }

}
